package com.offcn.webui.service;

import com.offcn.common.response.AppResponse;
import com.offcn.webui.service.impl.UserFeignServiceImpl;
import com.offcn.webui.vo.resp.UserAddressVo;
import com.offcn.webui.vo.resp.UserRespVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "SCW-USER",fallback = UserFeignServiceImpl.class)
public interface UserFeignService {

    @PostMapping("/user/login")
    public AppResponse<UserRespVo> login(@RequestParam String loginacct,@RequestParam String userpswd);

    @GetMapping("/user/getUser/{id}")
    public AppResponse<UserRespVo> getUserById(@PathVariable("id") Integer id);

    @GetMapping("/user/getAddress/{accessToken}")
    public AppResponse<List<UserAddressVo>> getAddressList(@PathVariable("accessToken") String accessToken);
}
